# Loughney et al., "Tectonic influence on Cenozoic mammal richness and sedimentation history of the Basin and Range, western North America"
# Science Advances
# Correlation analyses and output - raw values

# spearman_CI() calculates confidence intervals on Spearman's rank-order
# provided by user retodomax on Stackexchange.com (https://stats.stackexchange.com/questions/18887/how-to-calculate-a-confidence-interval-for-spearmans-rank-correlation)
> spearman_CI <- function(x, y, alpha = 0.05){
+     rs <- cor(x, y, method = "spearman", use = "complete.obs")
+     n <- sum(complete.cases(x, y))
+     sort(tanh(atanh(rs) + c(-1,1)*sqrt((1+rs^2/2)/(n-3))*qnorm(p = alpha/2)))
+ }

# load files
macrostrat <- read.csv("macrostrat_June-2021.csv", header = TRUE, stringsAsFactors = FALSE)
macrostrat_nonfossil <- read.csv("macrostrat_nonfossil_June-2021.csv", header = TRUE, stringsAsFactors = FALSE)
fossils <- read.csv("fossiliferous_units_January-2021.csv", header = TRUE, stringsAsFactors = FALSE)
deformation <- read.csv("deformation_rates_January-2021.csv", header = TRUE, stringsAsFactors = FALSE)
area <- read.csv("area_change.csv", header = TRUE, stringsAsFactors = FALSE)

# calculate SAR of fossiliferous units of the Basin and Range
brfossilsar <- fossils$NB_SAR + fossils$CB_SAR + fossils$SB_SAR

# correlation analyses
# ----------------------------------------------------------------------------------------------------------------------
# BR
# species richness - deformation rates to 0 Ma
> cor.test(brAllRichness[,2], deformation$BR_rate, method = "spearman")

	Spearmans rank correlation rho

data:  brAllRichness[, 2] and deformation$BR_rate
S = 22380, p-value = 1.405e-09
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.6401696 

Warning message:
In cor.test.default(brAllRichness[, 2], deformation$BR_rate, method = "spearman") :
  Cannot compute exact p-value with ties

> spearman_CI(brAllRichness[,2], deformation$BR_rate)
[1] 0.4616928 0.7688306

# species richness - deformation rates to 0.5 Ma
> cor.test(brAllRichness[2:72,2], deformation$BR_rate[2:72], method = "spearman")

	Spearmans rank correlation rho

data:  brAllRichness[2:72, 2] and deformation$BR_rate[2:72]
S = 19310, p-value = 9.696e-11
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.6762286 

Warning message:
In cor.test.default(brAllRichness[2:72, 2], deformation$BR_rate[2:72],  :
  Cannot compute exact p-value with ties

> spearman_CI(brAllRichness[2:72,2], deformation$BR_rate[2:72])
[1] 0.5069952 0.7952618

# species richness - area-change rates to 0 Ma
> cor.test(brAllRichness[,2], area$BR_rate_change_sum, method = "spearman")

	Spearmans rank correlation rho

data:  brAllRichness[, 2] and area$BR_rate_change_sum
S = 11109, p-value < 2.2e-16
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.8213947 

Warning message:
In cor.test.default(brAllRichness[, 2], area$BR_rate_change_sum, method = "spearman") :
  Cannot compute exact p-value with ties

> spearman_CI(brAllRichness[,2], area$BR_rate_change_sum)
[1] 0.7105166 0.8924739

# species richness - area-change rates to 0.5 Ma
> cor.test(brAllRichness[2:72,2], area$BR_rate_change_sum[2:72], method = "spearman")

	Spearmans rank correlation rho

data:  brAllRichness[2:72, 2] and area$BR_rate_change_sum[2:72]
S = 10455, p-value < 2.2e-16
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.8247044 

Warning message:
In cor.test.default(brAllRichness[2:72, 2], area$BR_rate_change_sum[2:72],  :
  Cannot compute exact p-value with ties

> spearman_CI(brAllRichness[2:72,2], area$BR_rate_change_sum[2:72])
[1] 0.7144463 0.8949971

# species richness - macrostrat SAR to 0 Ma
> cor.test(brAllRichness[,2], macrostrat$BR_SAR, method = "spearman")

	Spearmans rank correlation rho

data:  brAllRichness[, 2] and macrostrat$BR_SAR
S = 11442, p-value < 2.2e-16
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.8160409 

Warning message:
In cor.test.default(brAllRichness[, 2], macrostrat$BR_SAR, method = "spearman") :
  Cannot compute exact p-value with ties

> spearman_CI(brAllRichness[,2], macrostrat$BR_SAR)
[1] 0.7026089 0.8890272

# species richness - macrostrat SAR to 0.5 Ma
> cor.test(brAllRichness[2:72,2], macrostrat$BR_SAR[2:72], method = "spearman")

	Spearmans rank correlation rho

data:  brAllRichness[2:72, 2] and macrostrat$BR_SAR[2:72]
S = 11448, p-value < 2.2e-16
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.8080502 

Warning message:
In cor.test.default(brAllRichness[2:72, 2], macrostrat$BR_SAR[2:72],  :
  Cannot compute exact p-value with ties

> spearman_CI(brAllRichness[2:72,2], macrostrat$BR_SAR[2:72])
[1] 0.6898357 0.8842940

# species richness - number of macrostrat packages to 0 Ma
> cor.test(brAllRichness[,2], macrostrat$BR_number, method = "spearman")

	Spearmans rank correlation rho

data:  brAllRichness[, 2] and macrostrat$BR_number
S = 8010.4, p-value < 2.2e-16
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.8712068 

Warning message:
In cor.test.default(brAllRichness[, 2], macrostrat$BR_number,  :
  Cannot compute exact p-value with ties

> spearman_CI(brAllRichness[,2], macrostrat$BR_number)
[1] 0.7860214 0.9239242

# species richness - number of macrostrat packages to 0.5 Ma
> cor.test(brAllRichness[2:72,2], macrostrat$BR_number[2:72], method = "spearman")

	Spearmans rank correlation rho

data:  brAllRichness[2:72, 2] and macrostrat$BR_number[2:72]
S = 8015.2, p-value < 2.2e-16
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.8656069 

Warning message:
In cor.test.default(brAllRichness[2:72, 2], macrostrat$BR_number[2:72],  :
  Cannot compute exact p-value with ties

> spearman_CI(brAllRichness[2:72,2], macrostrat$BR_number[2:72])
[1] 0.7765489 0.9207535

# species richness - fossiliferous unit SAR to 0 Ma
> cor.test(brAllRichness[,2], brfossilsar, method = "spearman")

	Spearmans rank correlation rho

data:  brAllRichness[, 2] and brfossilsar
S = 12213, p-value < 2.2e-16
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.8036323 

Warning message:
In cor.test.default(brAllRichness[, 2], brfossilsar, method = "spearman") :
  Cannot compute exact p-value with ties

> spearman_CI(brAllRichness[,2], brfossilsar)
[1] 0.6844281 0.8809897

# species richness - fossiliferous unit SAR to 0.5 Ma
> cor.test(brAllRichness[2:72,2], brfossilsar[2:72], method = "spearman")

	Spearmans rank correlation rho

data:  brAllRichness[2:72, 2] and brfossilsar[2:72]
S = 11366, p-value < 2.2e-16
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.8094198 

Warning message:
In cor.test.default(brAllRichness[2:72, 2], brfossilsar[2:72], method = "spearman") :
  Cannot compute exact p-value with ties

> spearman_CI(brAllRichness[2:72,2], brfossilsar[2:72])
[1] 0.6918455 0.8851789

# species richness - number of fossiliferous units to 0 Ma
> cor.test(brAllRichness[,2], fossils$BR_number, method = "spearman")

	Spearmans rank correlation rho

data:  brAllRichness[, 2] and fossils$BR_number
S = 15293, p-value = 2.057e-14
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.7541233 

Warning message:
In cor.test.default(brAllRichness[, 2], fossils$BR_number, method = "spearman") :
  Cannot compute exact p-value with ties

> spearman_CI(brAllRichness[,2], fossils$BR_number)
[1] 0.6138305 0.8482415

# species richness - number of fossiliferous units to 0.5 Ma
> cor.test(brAllRichness[2:72,2], fossils$BR_number[2:72], method = "spearman")

	Spearmans rank correlation rho

data:  brAllRichness[2:72, 2] and fossils$BR_number[2:72]
S = 12767, p-value = 4.733e-16
alternative hypothesis: true rho is not equal to 0
sample estimates:
     rho 
0.785933 

Warning message:
In cor.test.default(brAllRichness[2:72, 2], fossils$BR_number[2:72], method = "spearman") :
  Cannot compute exact p-value with ties

> spearman_CI(brAllRichness[2:72,2], fossils$BR_number[2:72])
[1] 0.6577206 0.8698886

# species richness - number of fossil localities to 0 Ma
> cor.test(brAllRichness[,2], brBinLocs[,2], method = "spearman")

	Spearmans rank correlation rho

data:  brAllRichness[, 2] and brBinLocs[, 2]
S = 1636.8, p-value < 2.2e-16
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.9736836 

Warning message:
In cor.test.default(brAllRichness[, 2], brBinLocs[, 2], method = "spearman") :
  Cannot compute exact p-value with ties

> spearman_CI(brAllRichness[,2], brBinLocs[,2])
[1] 0.9537989 0.9850754

# species richness - number of fossil localities to 0.5 Ma
> cor.test(brAllRichness[2:72,2], brBinLocs[2:72,2], method = "spearman")

	Spearmans rank correlation rho

data:  brAllRichness[2:72, 2] and brBinLocs[2:72, 2]
S = 1638.7, p-value < 2.2e-16
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.9725241 

Warning message:
In cor.test.default(brAllRichness[2:72, 2], brBinLocs[2:72, 2],  :
  Cannot compute exact p-value with ties

> spearman_CI(brAllRichness[2:72,2], brBinLocs[2:72,2])
[1] 0.9515973 0.9844752

# --------------------------------------------------------------------------------------------------------------
# NB
# species richness - deformation rates to 0 Ma
> cor.test(nbAllRichness[,2], deformation$NB_rate, method = "spearman")

	Spearmans rank correlation rho

data:  nbAllRichness[, 2] and deformation$NB_rate
S = 17986, p-value = 2.654e-12
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.7108095 

Warning message:
In cor.test.default(nbAllRichness[, 2], deformation$NB_rate, method = "spearman") :
  Cannot compute exact p-value with ties

> spearman_CI(nbAllRichness[,2], deformation$NB_rate)
[1] 0.5544190 0.8187116

# species richness - deformation rates to 0.5 Ma
> cor.test(nbAllRichness[2:72,2], deformation$NB_rate[2:72], method = "spearman")

	Spearmans rank correlation rho

data:  nbAllRichness[2:72, 2] and deformation$NB_rate[2:72]
S = 17240, p-value = 3.751e-12
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.7109357 

Warning message:
In cor.test.default(nbAllRichness[2:72, 2], deformation$NB_rate[2:72],  :
  Cannot compute exact p-value with ties

> spearman_CI(nbAllRichness[2:72,2], deformation$NB_rate[2:72])
[1] 0.5532480 0.8194354

# species richness - area-change rates to 0 Ma
> cor.test(nbAllRichness[,2], area$NB_rate_change_sum, method = "spearman")

	Spearmans rank correlation rho

data:  nbAllRichness[, 2] and area$NB_rate_change_sum
S = 14901, p-value = 9.331e-15
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.7604186 

Warning message:
In cor.test.default(nbAllRichness[, 2], area$NB_rate_change_sum,  :
  Cannot compute exact p-value with ties
  
> spearman_CI(nbAllRichness[,2], area$NB_rate_change_sum)
[1] 0.6226421 0.8524654

# species richness - area-change rates to 0.5 Ma
> cor.test(nbAllRichness[2:72,2], area$NB_rate_change_sum[2:72], method = "spearman")

	Spearmans rank correlation rho

data:  nbAllRichness[2:72, 2] and area$NB_rate_change_sum[2:72]
S = 11927, p-value < 2.2e-16
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.8000166 

Warning message:
In cor.test.default(nbAllRichness[2:72, 2], area$NB_rate_change_sum[2:72],  :
  Cannot compute exact p-value with ties
  
> spearman_CI(nbAllRichness[2:72,2], area$NB_rate_change_sum[2:72])
[1] 0.6780970 0.8790867

# species richness - macrostrat SAR to 0 Ma
> cor.test(nbAllRichness[,2], macrostrat$NB_SAR, method = "spearman")

	Spearmans rank correlation rho

data:  nbAllRichness[, 2] and macrostrat$NB_SAR
S = 10925, p-value < 2.2e-16
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.8243489 

Warning message:
In cor.test.default(nbAllRichness[, 2], macrostrat$NB_SAR, method = "spearman") :
  Cannot compute exact p-value with ties

> spearman_CI(nbAllRichness[,2], macrostrat$NB_SAR)
[1] 0.7148966 0.8943702
  
# species richness - macrostrat SAR to 0.5 Ma
> cor.test(nbAllRichness[2:72,2], macrostrat$NB_SAR[2:72], method = "spearman")

	Spearmans rank correlation rho

data:  nbAllRichness[2:72, 2] and macrostrat$NB_SAR[2:72]
S = 10959, p-value < 2.2e-16
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.8162528 

Warning message:
In cor.test.default(nbAllRichness[2:72, 2], macrostrat$NB_SAR[2:72],  :
  Cannot compute exact p-value with ties

> spearman_CI(nbAllRichness[2:72,2], macrostrat$NB_SAR[2:72])
[1] 0.701910 0.889581

# species richness - number of macrostrat packages to 0 Ma
> cor.test(nbAllRichness[,2], macrostrat$NB_number, method = "spearman")

	Spearmans rank correlation rho

data:  nbAllRichness[, 2] and macrostrat$NB_number
S = 14048, p-value = 1.53e-15
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.7741276 

Warning message:
In cor.test.default(nbAllRichness[, 2], macrostrat$NB_number, method = "spearman") :
  Cannot compute exact p-value with ties

> spearman_CI(nbAllRichness[,2], macrostrat$NB_number)
[1] 0.6419937 0.8616037

# species richness - number of macrostrat packages to 0.5 Ma
> cor.test(nbAllRichness[2:72,2], macrostrat$NB_number[2:72], method = "spearman")

	Spearmans rank correlation rho

data:  nbAllRichness[2:72, 2] and macrostrat$NB_number[2:72]
S = 14098, p-value = 9.657e-15
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.7636109 

Warning message:
In cor.test.default(nbAllRichness[2:72, 2], macrostrat$NB_number[2:72],  :
  Cannot compute exact p-value with ties
  
> spearman_CI(nbAllRichness[2:72,2], macrostrat$NB_number[2:72])
[1] 0.6259349 0.8551296

# species richness - fossiliferous unit SAR to 0 Ma
> cor.test(nbAllRichness[,2], fossils$NB_SAR, method = "spearman")

	Spearmans rank correlation rho

data:  nbAllRichness[, 2] and fossils$NB_SAR
S = 8028.4, p-value < 2.2e-16
alternative hypothesis: true rho is not equal to 0
sample estimates:
     rho 
0.870918 

Warning message:
In cor.test.default(nbAllRichness[, 2], fossils$NB_SAR, method = "spearman") :
  Cannot compute exact p-value with ties

> spearman_CI(nbAllRichness[,2], fossils$NB_SAR)
[1] 0.7855732 0.9237451

# species richness - fossiliferous unit SAR to 0.5 Ma
> cor.test(nbAllRichness[2:72,2], fossils$NB_SAR[2:72], method = "spearman")

	Spearmans rank correlation rho

data:  nbAllRichness[2:72, 2] and fossils$NB_SAR[2:72]
S = 8045.9, p-value < 2.2e-16
alternative hypothesis: true rho is not equal to 0
sample estimates:
     rho 
0.865092 

Warning message:
In cor.test.default(nbAllRichness[2:72, 2], fossils$NB_SAR[2:72],  :
  Cannot compute exact p-value with ties
  
> spearman_CI(nbAllRichness[2:72,2], fossils$NB_SAR[2:72])
[1] 0.7757518 0.9204339

# species richness - number of fossiliferous units to 0 Ma
> cor.test(nbAllRichness[,2], fossils$NB_number, method = "spearman")

	Spearmans rank correlation rho

data:  nbAllRichness[, 2] and fossils$NB_number
S = 9637.2, p-value < 2.2e-16
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.8450504 

Warning message:
In cor.test.default(nbAllRichness[, 2], fossils$NB_number, method = "spearman") :
  Cannot compute exact p-value with ties
  
> spearman_CI(nbAllRichness[,2], fossils$NB_number)
[1] 0.745929 0.907549

# species richness - number of fossiliferous units to 0.5 Ma
> cor.test(nbAllRichness[2:72,2], fossils$NB_number[2:72], method = "spearman")

	Spearmans rank correlation rho

data:  nbAllRichness[2:72, 2] and fossils$NB_number[2:72]
S = 8956, p-value < 2.2e-16
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.8498329 

Warning message:
In cor.test.default(nbAllRichness[2:72, 2], fossils$NB_number[2:72],  :
  Cannot compute exact p-value with ties
  
> spearman_CI(nbAllRichness[2:72,2], fossils$NB_number[2:72])
[1] 0.7523104 0.9109101

# species richness - number of fossil localities to 0 Ma
> cor.test(nbAllRichness[,2], nbBinLocs[,2], method = "spearman")

	Spearmans rank correlation rho

data:  nbAllRichness[, 2] and nbBinLocs[, 2]
S = 541.56, p-value < 2.2e-16
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.9912927 

Warning message:
In cor.test.default(nbAllRichness[, 2], nbBinLocs[, 2], method = "spearman") :
  Cannot compute exact p-value with ties
  
> spearman_CI(nbAllRichness[,2], nbBinLocs[,2])
[1] 0.9845584 0.9950973

# species richness - number of fossil localities to 0.5 Ma
> cor.test(nbAllRichness[2:72,2], nbBinLocs[2:72,2], method = "spearman")

	Spearmans rank correlation rho

data:  nbAllRichness[2:72, 2] and nbBinLocs[2:72, 2]
S = 546.01, p-value < 2.2e-16
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.9908449 

Warning message:
In cor.test.default(nbAllRichness[2:72, 2], nbBinLocs[2:72, 2],  :
  Cannot compute exact p-value with ties
  
> spearman_CI(nbAllRichness[2:72,2], nbBinLocs[2:72,2])
[1] 0.9837004 0.9948659

# --------------------------------------------------------------------------------------------------------------------
# CB
# species richness - deformation rates to 0 Ma
> cor.test(cbAllRichness[,2], deformation$CB_rate, method = "spearman")

	Spearmans rank correlation rho

data:  cbAllRichness[, 2] and deformation$CB_rate
S = 11398, p-value < 2.2e-16
alternative hypothesis: true rho is not equal to 0
sample estimates:
     rho 
0.816744 

Warning message:
In cor.test.default(cbAllRichness[, 2], deformation$CB_rate, method = "spearman") :
  Cannot compute exact p-value with ties

> spearman_CI(cbAllRichness[,2], deformation$CB_rate)
[1] 0.7036451 0.8894806

# species richness - deformation rates to 0.5 Ma
> cor.test(cbAllRichness[2:72,2], deformation$CB_rate[2:72], method = "spearman")

	Spearmans rank correlation rho

data:  cbAllRichness[2:72, 2] and deformation$CB_rate[2:72]
S = 8655.9, p-value < 2.2e-16
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.8548642 

Warning message:
In cor.test.default(cbAllRichness[2:72, 2], deformation$CB_rate[2:72],  :
  Cannot compute exact p-value with ties

> spearman_CI(cbAllRichness[2:72,2], deformation$CB_rate[2:72])
[1] 0.7600013 0.9140620

# species richness - area-change rates to 0 Ma
> cor.test(cbAllRichness[,2], area$CB_rate_change_sum, method = "spearman")

	Spearmans rank correlation rho

data:  cbAllRichness[, 2] and area$CB_rate_change_sum
S = 13277, p-value = 2.666e-16
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.7865254 

Warning message:
In cor.test.default(cbAllRichness[, 2], area$CB_rate_change_sum,  :
  Cannot compute exact p-value with ties
  
> spearman_CI(cbAllRichness[,2], area$CB_rate_change_sum)
[1] 0.6596912 0.8697965

# species richness - area-change rates to 0.5 Ma
> cor.test(cbAllRichness[2:72,2], area$CB_rate_change_sum[2:72], method = "spearman")

	Spearmans rank correlation rho

data:  cbAllRichness[2:72, 2] and area$CB_rate_change_sum[2:72]
S = 11781, p-value < 2.2e-16
alternative hypothesis: true rho is not equal to 0
sample estimates:
     rho 
0.802469 

Warning message:
In cor.test.default(cbAllRichness[2:72, 2], area$CB_rate_change_sum[2:72],  :
  Cannot compute exact p-value with ties
  
> spearman_CI(cbAllRichness[2:72,2], area$CB_rate_change_sum[2:72])
[1] 0.6816715 0.8806794

# species richness - macrostrat SAR to 0 Ma
> cor.test(cbAllRichness[,2], macrostrat$CB_SAR, method = "spearman")

	Spearmans rank correlation rho

data:  cbAllRichness[, 2] and macrostrat$CB_SAR
S = 30558, p-value = 5.059e-06
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.5086856 

Warning message:
In cor.test.default(cbAllRichness[, 2], macrostrat$CB_SAR, method = "spearman") :
  Cannot compute exact p-value with ties
  
> spearman_CI(cbAllRichness[,2], macrostrat$CB_SAR)
[1] 0.3006221 0.6705306

# species richness - macrostrat SAR to 0.5 Ma
> cor.test(cbAllRichness[2:72,2], macrostrat$CB_SAR[2:72], method = "spearman")

	Spearmans rank correlation rho

data:  cbAllRichness[2:72, 2] and macrostrat$CB_SAR[2:72]
S = 30611, p-value = 1.677e-05
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.4867329 

Warning message:
In cor.test.default(cbAllRichness[2:72, 2], macrostrat$CB_SAR[2:72],  :
  Cannot compute exact p-value with ties

> spearman_CI(cbAllRichness[2:72,2], macrostrat$CB_SAR[2:72])
[1] 0.2732809 0.6545017

# species richness - number of macrostrat packages to 0 Ma
> cor.test(cbAllRichness[,2], macrostrat$CB_number, method = "spearman")

	Spearmans rank correlation rho

data:  cbAllRichness[, 2] and macrostrat$CB_number
S = 30905, p-value = 6.667e-06
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.5030978 

Warning message:
In cor.test.default(cbAllRichness[, 2], macrostrat$CB_number, method = "spearman") :
  Cannot compute exact p-value with ties
  
> spearman_CI(cbAllRichness[,2], macrostrat$CB_number)
[1] 0.2940625 0.6662018

# species richness - number of macrostrat packages to 0.5 Ma
> cor.test(cbAllRichness[2:72,2], macrostrat$CB_number[2:72], method = "spearman")

	Spearmans rank correlation rho

data:  cbAllRichness[2:72, 2] and macrostrat$CB_number[2:72]
S = 30971, p-value = 2.206e-05
alternative hypothesis: true rho is not equal to 0
sample estimates:
     rho 
0.480699 

Warning message:
In cor.test.default(cbAllRichness[2:72, 2], macrostrat$CB_number[2:72],  :
  Cannot compute exact p-value with ties
  
> spearman_CI(cbAllRichness[2:72,2], macrostrat$CB_number[2:72])
[1] 0.2662816 0.6497862

# species richness - fossiliferous unit SAR to 0 Ma
> cor.test(cbAllRichness[,2], fossils$CB_SAR, method = "spearman")

	Spearmans rank correlation rho

data:  cbAllRichness[, 2] and fossils$CB_SAR
S = 22536, p-value = 1.705e-09
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.6376572 

Warning message:
In cor.test.default(cbAllRichness[, 2], fossils$CB_SAR, method = "spearman") :
  Cannot compute exact p-value with ties
  
> spearman_CI(cbAllRichness[,2], fossils$CB_SAR)
[1] 0.4584821 0.7670179

# species richness - fossiliferous unit SAR to 0.5 Ma
> cor.test(cbAllRichness[2:72,2], fossils$CB_SAR[2:72], method = "spearman")

	Spearmans rank correlation rho

data:  cbAllRichness[2:72, 2] and fossils$CB_SAR[2:72]
S = 18195, p-value = 1.78e-11
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.6949234 

Warning message:
In cor.test.default(cbAllRichness[2:72, 2], fossils$CB_SAR[2:72],  :
  Cannot compute exact p-value with ties
  
> spearman_CI(cbAllRichness[2:72,2], fossils$CB_SAR[2:72])
[1] 0.5317554 0.8083468

# species richness - number of fossiliferous units to 0 Ma
> cor.test(cbAllRichness[,2], fossils$CB_number, method = "spearman")

	Spearmans rank correlation rho

data:  cbAllRichness[, 2] and fossils$CB_number
S = 19427, p-value = 2.519e-11
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.6876532 

Warning message:
In cor.test.default(cbAllRichness[, 2], fossils$CB_number, method = "spearman") :
  Cannot compute exact p-value with ties
  
> spearman_CI(cbAllRichness[,2], fossils$CB_number)
[1] 0.5234814 0.8025930

# species richness - number of fossiliferous units to 0.5 Ma
> cor.test(cbAllRichness[2:72,2], fossils$CB_number[2:72], method = "spearman")

	Spearmans rank correlation rho

data:  cbAllRichness[2:72, 2] and fossils$CB_number[2:72]
S = 17697, p-value = 8.003e-12
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.7032761 

Warning message:
In cor.test.default(cbAllRichness[2:72, 2], fossils$CB_number[2:72],  :
  Cannot compute exact p-value with ties
  
> spearman_CI(cbAllRichness[2:72,2], fossils$CB_number[2:72])
[1] 0.5429333 0.8141449

# species richness - number of fossil localities to 0 Ma
> cor.test(cbAllRichness[,2], cbBinLocs[,2], method = "spearman")

	Spearmans rank correlation rho

data:  cbAllRichness[, 2] and cbBinLocs[, 2]
S = 907.2, p-value < 2.2e-16
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.9854139 

Warning message:
In cor.test.default(cbAllRichness[, 2], cbBinLocs[, 2], method = "spearman") :
  Cannot compute exact p-value with ties
  
> spearman_CI(cbAllRichness[,2], cbBinLocs[,2])
[1] 0.9742204 0.9917674

# species richness - number of fossil localities to 0.5 Ma
> cor.test(cbAllRichness[2:72,2], cbBinLocs[2:72,2], method = "spearman")

	Spearmans rank correlation rho

data:  cbAllRichness[2:72, 2] and cbBinLocs[2:72, 2]
S = 902.69, p-value < 2.2e-16
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.9848644 

Warning message:
In cor.test.default(cbAllRichness[2:72, 2], cbBinLocs[2:72, 2],  :
  Cannot compute exact p-value with ties
  
> spearman_CI(cbAllRichness[2:72,2], cbBinLocs[2:72,2])
[1] 0.9731463 0.9914911

# ------------------------------------------------------------------------------------------------------------------------
# SB
# species richness - deformation rates to 0 Ma
> cor.test(sbAllRichness[,2], deformation$SB_rate, method = "spearman")

	Spearmans rank correlation rho

data:  sbAllRichness[, 2] and deformation$SB_rate
S = 68377, p-value = 0.4062
alternative hypothesis: true rho is not equal to 0
sample estimates:
        rho 
-0.09937643 

Warning message:
In cor.test.default(sbAllRichness[, 2], deformation$SB_rate, method = "spearman") :
  Cannot compute exact p-value with ties
  
> spearman_CI(sbAllRichness[,2], deformation$SB_rate)
[1] -0.3241159  0.1359807

# species richness - deformation rates to 0.5 Ma
> cor.test(sbAllRichness[2:72,2], deformation$SB_rate[2:72], method = "spearman")

	Spearmans rank correlation rho

data:  sbAllRichness[2:72, 2] and deformation$SB_rate[2:72]
S = 64184, p-value = 0.5277
alternative hypothesis: true rho is not equal to 0
sample estimates:
        rho 
-0.07619255 

Warning message:
In cor.test.default(sbAllRichness[2:72, 2], deformation$SB_rate[2:72],  :
  Cannot compute exact p-value with ties
  
> spearman_CI(sbAllRichness[2:72,2], deformation$SB_rate[2:72])
[1] -0.3044036  0.1602904

# species richness - area-change rates to 0 Ma
> cor.test(sbAllRichness[,2], area$SB_rate_change_sum, method = "spearman")

	Spearmans rank correlation rho

data:  sbAllRichness[, 2] and area$SB_rate_change_sum
S = 38416, p-value = 0.0009187
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.3823342 

Warning message:
In cor.test.default(sbAllRichness[, 2], area$SB_rate_change_sum,  :
  Cannot compute exact p-value with ties
  
> spearman_CI(sbAllRichness[,2], area$SB_rate_change_sum)
[1] 0.1570571 0.5697910

# species richness - area-change rates to 0.5 Ma
> cor.test(sbAllRichness[2:72,2], area$SB_rate_change_sum[2:72], method = "spearman")

	Spearmans rank correlation rho

data:  sbAllRichness[2:72, 2] and area$SB_rate_change_sum[2:72]
S = 36675, p-value = 0.0009135
alternative hypothesis: true rho is not equal to 0
sample estimates:
     rho 
0.385066 

Warning message:
In cor.test.default(sbAllRichness[2:72, 2], area$SB_rate_change_sum[2:72],  :
  Cannot compute exact p-value with ties
  
> spearman_CI(sbAllRichness[2:72,2], area$SB_rate_change_sum[2:72])
[1] 0.1583175 0.5732349

# species richness - macrostrat SAR to 0 Ma
> cor.test(sbAllRichness[,2], macrostrat$SB_SAR, method = "spearman")

	Spearmans rank correlation rho

data:  sbAllRichness[, 2] and macrostrat$SB_SAR
S = 25086, p-value = 3.183e-08
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.5966549 

Warning message:
In cor.test.default(sbAllRichness[, 2], macrostrat$SB_SAR, method = "spearman") :
  Cannot compute exact p-value with ties
  
> spearman_CI(sbAllRichness[,2], macrostrat$SB_SAR)
[1] 0.4068619 0.7370678

# species richness - macrostrat SAR to 0.5 Ma
> cor.test(sbAllRichness[2:72,2], macrostrat$SB_SAR[2:72], method = "spearman")

	Spearmans rank correlation rho

data:  sbAllRichness[2:72, 2] and macrostrat$SB_SAR[2:72]
S = 25103, p-value = 1.22e-07
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.5790892 

Warning message:
In cor.test.default(sbAllRichness[2:72, 2], macrostrat$SB_SAR[2:72],  :
  Cannot compute exact p-value with ties
  
> spearman_CI(sbAllRichness[2:72,2], macrostrat$SB_SAR[2:72])
[1] 0.3835849 0.7249149

# species richness - number of macrostrat packages to 0 Ma
> cor.test(sbAllRichness[,2], macrostrat$SB_number, method = "spearman")

	Spearmans rank correlation rho

data:  sbAllRichness[, 2] and macrostrat$SB_number
S = 25472, p-value = 4.785e-08
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.5904536 

Warning message:
In cor.test.default(sbAllRichness[, 2], macrostrat$SB_number, method = "spearman") :
  Cannot compute exact p-value with ties
  
> spearman_CI(sbAllRichness[,2], macrostrat$SB_number)
[1] 0.3991779 0.7324783

# species richness - number of macrostrat packages to 0.5 Ma
> cor.test(sbAllRichness[2:72,2], macrostrat$SB_number[2:72], method = "spearman")

	Spearmans rank correlation rho

data:  sbAllRichness[2:72, 2] and macrostrat$SB_number[2:72]
S = 25424, p-value = 1.695e-07
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.5737163 

Warning message:
In cor.test.default(sbAllRichness[2:72, 2], macrostrat$SB_number[2:72],  :
  Cannot compute exact p-value with ties
  
> spearman_CI(sbAllRichness[2:72,2], macrostrat$SB_number[2:72])
[1] 0.3769939 0.7209110

# species richness - fossiliferous unit SAR to 0 Ma
> cor.test(sbAllRichness[,2], fossils$SB_SAR, method = "spearman")

	Spearmans rank correlation rho

data:  sbAllRichness[, 2] and fossils$SB_SAR
S = 32928, p-value = 3.028e-05
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.4705796 

Warning message:
In cor.test.default(sbAllRichness[, 2], fossils$SB_SAR, method = "spearman") :
  Cannot compute exact p-value with ties
  
> spearman_CI(sbAllRichness[,2], fossils$SB_SAR)
[1] 0.2562987 0.6407742

# species richness - fossiliferous unit SAR to 0.5 Ma
> cor.test(sbAllRichness[2:72,2], fossils$SB_SAR[2:72], method = "spearman")

	Spearmans rank correlation rho

data:  sbAllRichness[2:72, 2] and fossils$SB_SAR[2:72]
S = 28367, p-value = 2.684e-06
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.5243704 

Warning message:
In cor.test.default(sbAllRichness[2:72, 2], fossils$SB_SAR[2:72],  :
  Cannot compute exact p-value with ties
  
> spearman_CI(sbAllRichness[2:72,2], fossils$SB_SAR[2:72])
[1] 0.3174922 0.6836002

# species richness - number of fossiliferous units to 0 Ma
> cor.test(sbAllRichness[,2], fossils$SB_number, method = "spearman")

	Spearmans rank correlation rho

data:  sbAllRichness[, 2] and fossils$SB_number
S = 34502, p-value = 8.886e-05
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.4452621 

Warning message:
In cor.test.default(sbAllRichness[, 2], fossils$SB_number, method = "spearman") :
  Cannot compute exact p-value with ties
  
> spearman_CI(sbAllRichness[,2], fossils$SB_number)
[1] 0.2273608 0.6207016

# species richness - number of fossiliferous units to 0.5 Ma
> cor.test(sbAllRichness[2:72,2], fossils$SB_number[2:72], method = "spearman")

	Spearmans rank correlation rho

data:  sbAllRichness[2:72, 2] and fossils$SB_number[2:72]
S = 29916, p-value = 9.73e-06
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.4983926 

Warning message:
In cor.test.default(sbAllRichness[2:72, 2], fossils$SB_number[2:72],  :
  Cannot compute exact p-value with ties
  
> spearman_CI(sbAllRichness[2:72,2], fossils$SB_number[2:72])
[1] 0.2868742 0.6635745

# species richness - number of fossil localities to 0 Ma
> cor.test(sbAllRichness[,2], sbBinLocs[,2], method = "spearman")

	Spearmans rank correlation rho

data:  sbAllRichness[, 2] and sbBinLocs[, 2]
S = 1647.5, p-value < 2.2e-16
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.9735118 

Warning message:
In cor.test.default(sbAllRichness[, 2], sbBinLocs[, 2], method = "spearman") :
  Cannot compute exact p-value with ties
  
> spearman_CI(sbAllRichness[,2], sbBinLocs[,2])
[1] 0.9535019 0.9849769

# species richness - number of fossiliferous units to 0.5 Ma
> cor.test(sbAllRichness[2:72,2], sbBinLocs[2:72,2], method = "spearman")

	Spearmans rank correlation rho

data:  sbAllRichness[2:72, 2] and sbBinLocs[2:72, 2]
S = 1649.7, p-value < 2.2e-16
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho 
0.9723392 

Warning message:
In cor.test.default(sbAllRichness[2:72, 2], sbBinLocs[2:72, 2],  :
  Cannot compute exact p-value with ties

> spearman_CI(sbAllRichness[2:72,2], sbBinLocs[2:72,2])
[1] 0.9512766 0.9843696